package miniproj.exception;

import miniproj.models.room.Room;

/**
 * This class is a personalized Exception concerning rooms capacity problems
 * 
 * @author Baptiste Viale
 * 
 */
@SuppressWarnings("serial")
public class CapacityException extends java.lang.IllegalArgumentException {

	/**
	 * Instantiates a new capacity exception.
	 * 
	 * @param room
	 *            the room concerned by the exception
	 * @param asked
	 *            the capacity asked
	 */
	public CapacityException(Room room, int asked) {
		super("Capacity of " + asked
				+ " asked whereas capacity must be contained between "
				+ room.getMinCapacity() + " and " + room.getMaxCapacity());
	}

	/**
	 * Instantiates a new capacity exception.
	 * 
	 * @param room
	 *            the room concerned by the exception
	 * @param asked
	 *            the capacity asked
	 */
	public CapacityException(int capacity, int asked) {
		super("Capacity of " + asked + " asked whereas capacity must be "
				+ capacity);
	}
}
